using MOKA.TPM.Utility.Const;
using SqlSugar;
using System.ComponentModel.DataAnnotations;

namespace MOKA.TPM.Entity;

/// <summary>
/// 非采物料参数
/// </summary>
[Tenant(TPMConst.TPMConfigId)]
[SugarTable("PartsParas", "非采物料参数")]
public class PartsParas
{
    /// <summary>
    /// 
    /// </summary>
    [SugarColumn(ColumnName = "Id", ColumnDescription = "", IsPrimaryKey = true, IsIdentity = true)]
    public long Id { get; set; }

    /// <summary>
    /// 非采物料
    /// </summary>
    [SugarColumn(ColumnName = "PartsId", ColumnDescription = "非采物料")]
    public Guid PartsId { get; set; }

    /// <summary>
    /// 参数名称
    /// </summary>
    [SugarColumn(ColumnName = "ParaName", ColumnDescription = "参数名称")]
    public int ParaName { get; set; }

    /// <summary>
    /// 参数值
    /// </summary>
    [SugarColumn(ColumnName = "ParaValue", ColumnDescription = "参数值", Length = 200)]
    [Required, MaxLength(200)]
    public string ParaValue { get; set; } = string.Empty;

    /// <summary>
    /// 创建人
    /// </summary>
    [SugarColumn(ColumnName = "CreateUser", ColumnDescription = "创建人", Length = 20)]
    [Required, MaxLength(20)]
    public string CreateUser { get; set; } = string.Empty;

    /// <summary>
    /// 创建时间
    /// </summary>
    [SugarColumn(ColumnName = "CreateTime", ColumnDescription = "创建时间")]
    public DateTime CreateTime { get; set; }

    /// <summary>
    /// 修改人
    /// </summary>
    [SugarColumn(ColumnName = "UpdateUser", ColumnDescription = "修改人", Length = 20)]
    [MaxLength(20)]
    public string? UpdateUser { get; set; }

    /// <summary>
    /// 修改时间
    /// </summary>
    [SugarColumn(ColumnName = "UpdateTime", ColumnDescription = "修改时间")]
    public DateTime? UpdateTime { get; set; }

    /// <summary>
    /// PartsId (非采物料) 对应的外键实体
    /// </summary>
    [Navigate(NavigateType.ManyToOne, nameof(PartsId),nameof(Parts.Id))]//多对一
    public Parts parts_PartsId { get; set; }

    /// <summary>
    /// CreateUser (创建人) 对应的外键实体
    /// </summary>
    [Navigate(NavigateType.ManyToOne, nameof(CreateUser),nameof(T_USER.UserName))]//多对一
    public T_USER t__USER_CreateUser { get; set; }

    /// <summary>
    /// UpdateUser (修改人) 对应的外键实体
    /// </summary>
    [Navigate(NavigateType.ManyToOne, nameof(UpdateUser),nameof(T_USER.UserName))]//多对一
    public T_USER t__USER_UpdateUser { get; set; }
}